package com.example.superoa.model.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * The persistent class for the rapply database table.
 * 
 */
@Entity
@NamedQuery(name="Rapply.findAll", query="SELECT r FROM Rapply r")
public class Rapply implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	private int rapplyid;

	private String rapplybou;

	@Temporal(TemporalType.TIMESTAMP)
	private Date rapplyend;

	private BigDecimal rapplymoney;

	private String rapplyname;

	private int rapplynums;

	@Temporal(TemporalType.TIMESTAMP)
	private Date rapplystart;

	private int rapplystatue;
	
	private String rapplyreason;
	
	private Date rapplytime;
	
	private Date rapplysptime;
	
	private int rapplyspstatue;

	//bi-directional many-to-one association to Rplan
	@ManyToOne
	@JoinColumn(name="rplanid")
	private Rplan rplan;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="staff_id")
	private Staff staff1;

	//bi-directional many-to-one association to Staff
	@ManyToOne
	@JoinColumn(name="STA_staff_id")
	private Staff staff2;

	//bi-directional many-to-one association to Rbiographical
	@OneToMany(mappedBy="rapply")
	private List<Rbiographical> rbiographicals;

	public Rapply() {
	}

	public int getRapplyid() {
		return this.rapplyid;
	}

	public void setRapplyid(int rapplyid) {
		this.rapplyid = rapplyid;
	}

	public String getRapplybou() {
		return this.rapplybou;
	}

	public void setRapplybou(String rapplybou) {
		this.rapplybou = rapplybou;
	}

	public Date getRapplyend() {
		return this.rapplyend;
	}

	public void setRapplyend(Date rapplyend) {
		this.rapplyend = rapplyend;
	}

	public BigDecimal getRapplymoney() {
		return this.rapplymoney;
	}

	public void setRapplymoney(BigDecimal rapplymoney) {
		this.rapplymoney = rapplymoney;
	}

	public String getRapplyname() {
		return this.rapplyname;
	}

	public void setRapplyname(String rapplyname) {
		this.rapplyname = rapplyname;
	}

	public int getRapplynums() {
		return this.rapplynums;
	}

	public void setRapplynums(int rapplynums) {
		this.rapplynums = rapplynums;
	}

	public Date getRapplystart() {
		return this.rapplystart;
	}

	public void setRapplystart(Date rapplystart) {
		this.rapplystart = rapplystart;
	}

	public int getRapplystatue() {
		return this.rapplystatue;
	}

	public void setRapplystatue(int rapplystatue) {
		this.rapplystatue = rapplystatue;
	}

	public String getRapplyreason() {
		return rapplyreason;
	}

	public void setRapplyreason(String rapplyreason) {
		this.rapplyreason = rapplyreason;
	}

	public Date getRapplytime() {
		return rapplytime;
	}

	public void setRapplytime(Date rapplytime) {
		this.rapplytime = rapplytime;
	}

	public Date getRapplysptime() {
		return rapplysptime;
	}

	public void setRapplysptime(Date rapplysptime) {
		this.rapplysptime = rapplysptime;
	}

	public int getRapplyspstatue() {
		return rapplyspstatue;
	}

	public void setRapplyspstatue(int rapplyspstatue) {
		this.rapplyspstatue = rapplyspstatue;
	}

	public Rplan getRplan() {
		return this.rplan;
	}

	public void setRplan(Rplan rplan) {
		this.rplan = rplan;
	}

	public Staff getStaff1() {
		return this.staff1;
	}

	public void setStaff1(Staff staff1) {
		this.staff1 = staff1;
	}

	public Staff getStaff2() {
		return this.staff2;
	}

	public void setStaff2(Staff staff2) {
		this.staff2 = staff2;
	}

	public List<Rbiographical> getRbiographicals() {
		return this.rbiographicals;
	}

	public void setRbiographicals(List<Rbiographical> rbiographicals) {
		this.rbiographicals = rbiographicals;
	}

	public Rbiographical addRbiographical(Rbiographical rbiographical) {
		getRbiographicals().add(rbiographical);
		rbiographical.setRapply(this);

		return rbiographical;
	}

	public Rbiographical removeRbiographical(Rbiographical rbiographical) {
		getRbiographicals().remove(rbiographical);
		rbiographical.setRapply(null);

		return rbiographical;
	}
}